const n = require("../../utils/request"); 
Page({
    data: {
        docDetail: {}
    },
    onLoad: function(options) {
        const zid = options.id; 
        this.getDocDetail(zid);
    },
        getDocDetail: function(id) {
        let that = this;
        n.post1("/wechat/Home/getDocDetail",{id:id}).then(function(e) {
            if(e.code == 1){
                e.data.content = e.data.content.replace(/\<img/g,'<img style="width:100%;height:auto;display:block"');
                that.setData({
                    docDetail:  e.data
                });
            }else {
                wx.showToast({
                    title:e.msg,
                    icon:'none',
                    duration:2000
                })
            }
        })
    }
});